<template>
  user2:<br/>
  ID:{{ $route.params.id }}<br/>
  userName:{{ $route.params.username }}<br/>
  password:{{ $route.params.password }}
  <h2>通过props接收参数</h2>
  id:{{id}}<br/>
  userName:{{username}}<br/>
  password:{{password}}<br/>
  <button @click="execFun">调用props中的数据</button>
</template>

<script setup>
 const props = defineProps(['id','username','password'])

 function execFun(){
   console.log(props.id)
   console.log(props.username)
   console.log(props.password)
 }

</script>

<style scoped>

</style>